/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.skycode.core.manager;

import com.skycode.core.exception.DAOException;
import com.skycode.core.hibernate.dao.DAOSkycode;
import java.io.Serializable;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;

/**
 * @author SkyCode (skycode@gmail.com)
 * @since 07/02/2014
 * @version 1.0
 */
@Service
public class ComunManager<Dto> implements Serializable {

    @Resource
    private DAOSkycode<Dto> springHibernateDao;

    public void nuevo(Dto entidadDto) throws DAOException {
        springHibernateDao.save(entidadDto);
    }

    public void editar(Dto entidadDto) throws DAOException {
        springHibernateDao.update(entidadDto);
    }

    public void eliminar(Dto entidadDto) throws DAOException {
        springHibernateDao.delete(entidadDto);
    }

    public void refrescar(Dto entidadDto) throws DAOException {
        springHibernateDao.refresh(entidadDto);
    }

    public void flush() throws DAOException {
        springHibernateDao.flush();
    }
}